home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / term-source.lha / Extras / Source / term-Source.lha / ModemPanel.c < prev    next >
C/C++ Source or Header  |  1995-06-19  |  13KB  |  565 lines

  1. /*
  2. **    ModemPanel.c
  3. **
  4. **    Editing panel for modem configuration
  5. **
  6. **    Copyright © 1990-1995 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10. #include "termGlobal.h"
  11.  
  12. enum    {    GAD_LIMIT_MACRO=1000,GAD_DIAL_PREFIX,GAD_DIAL_SUFFIX,
  13.         GAD_DIAL_MODE,GAD_USE,GAD_CANCEL,GAD_DEFAULT,
  14.         GAD_PAGER,GAD_PAGEGROUP,GAD_INTER_DIAL_DELAY,
  15.     };
  16.  
  17. STATIC UBYTE * __saveds
  18. ShowDialRetries(struct Gadget *SomeGadget,WORD Level)
  19. {
  20.     if(Level < 0)
  21.         return(LocaleString(MSG_DIAL_RETRIES_UNLIMITED_TXT));
  22.     else
  23.     {
  24.         STATIC UBYTE __far Buffer[10];
  25.  
  26.         SPrintf(Buffer,"%ld",Level);
  27.  
  28.         return(Buffer);
  29.     }
  30. }
  31.  
  32. STATIC UBYTE * __saveds
  33. ShowHours(struct Gadget *SomeGadget,WORD Level)
  34. {
  35.     STATIC UBYTE __far Buffer[15];
  36.  
  37.     SPrintf(Buffer,LocaleString(MSG_GLOBAL_SHOW_HOURS_TXT),Level / 60,Level % 60);
  38.  
  39.     return(Buffer);
  40. }
  41.  
  42. STATIC UBYTE * __saveds
  43. ShowSeconds(struct Gadget *SomeGadget,WORD Level)
  44. {
  45.     STATIC UBYTE __far Buffer[15];
  46.  
  47.     SPrintf(Buffer,LocaleString(MSG_GLOBAL_SHOW_MINUTES_TXT),Level / 60,Level % 60);
  48.  
  49.     return(Buffer);
  50. }
  51.  
  52. BYTE __regargs
  53. ModemPanel(struct Configuration *Config,BYTE *Default)
  54. {
  55.     STATIC LONG PageTitleID[6] =
  56.     {
  57.         MSG_V36_0110,
  58.         MSG_V36_0111,
  59.         MSG_V36_0112,
  60.         MSG_V36_0116,
  61.         MSG_V36_0118,
  62.         -1
  63.     };
  64.  
  65.     STATIC BYTE InitialPage = 0;
  66.  
  67.     struct LayoutHandle    *Handle;
  68.     BYTE             Cancel = FALSE;
  69.     STRPTR             PageTitle[6];
  70.  
  71.     LocalizeStringTable(PageTitle,PageTitleID);
  72.  
  73.     SaveConfig(Config,PrivateConfig);
  74.  
  75.     if(Handle = LT_CreateHandleTags(Window -> WScreen,
  76.         LH_LocaleHook,    &LocaleHook,
  77.         LH_ExitFlush,    FALSE,
  78.     TAG_DONE))
  79.     {
  80.         struct Window *PanelWindow;
  81.  
  82.         LT_New(Handle,
  83.             LA_Type,    VERTICAL_KIND,
  84.         TAG_DONE);
  85.         {
  86.             LT_New(Handle,
  87.                 LA_Type,VERTICAL_KIND,
  88.             TAG_DONE);
  89.             {
  90.                 LT_New(Handle,
  91.                     LA_Type,    CYCLE_KIND,
  92.                     LA_ID,        GAD_PAGER,
  93.                     LA_LabelID,    MSG_XFER_PAGE_TXT,
  94.                     GTCY_Labels,    PageTitle,
  95.                     LACY_AutoPageID,GAD_PAGEGROUP,
  96.                     LACY_TabKey,    TRUE,
  97.                     LA_BYTE,    &InitialPage,
  98.                 TAG_DONE);
  99.  
  100.                 LT_EndGroup(Handle);
  101.             }
  102.  
  103.             LT_New(Handle,
  104.                 LA_Type,    VERTICAL_KIND,
  105.                 LA_ID,        GAD_PAGEGROUP,
  106.                 LAGR_Frame,    TRUE,
  107.                 LAGR_ActivePage,InitialPage,
  108.             TAG_DONE);
  109.             {
  110.                 LT_New(Handle,
  111.                     LA_Type,    VERTICAL_KIND,
  112.                 TAG_DONE);
  113.                 {
  114.                     LT_New(Handle,
  115.                         LA_Type,    STRING_KIND,
  116.                         LA_LabelID,    MSG_MODEMPANEL_MODEM_INIT_STRING_GAD,
  117.                         LA_STRPTR,    Config -> ModemConfig -> ModemInit,
  118.                         LA_Chars,    20,
  119.                         GTST_MaxChars,    79,
  120.                     TAG_DONE);
  121.  
  122.                     LT_New(Handle,
  123.                         LA_Type,    STRING_KIND,
  124.                         LA_LabelID,    MSG_MODEMPANEL_MODEM_EXIT_STRING_GAD,
  125.                         LA_STRPTR,    Config -> ModemConfig -> ModemExit,
  126.                         GTST_MaxChars,    79,
  127.                     TAG_DONE);
  128.  
  129.                     LT_New(Handle,
  130.                         LA_Type,    STRING_KIND,
  131.                         LA_LabelID,    MSG_MODEMPANEL_MODEM_HANGUP_STRING_GAD,
  132.                         LA_STRPTR,    Config -> ModemConfig -> ModemHangup,
  133.                         GTST_MaxChars,    79,
  134.                     TAG_DONE);
  135.  
  136.                     LT_New(Handle,
  137.                         LA_Type,    XBAR_KIND,
  138.                     TAG_DONE);
  139.  
  140.                     LT_New(Handle,
  141.                         LA_Type,        INTEGER_KIND,
  142.                         LA_LabelID,        MSG_COMMAND_SEND_DELAY_TXT,
  143.                         LA_LONG,        &Config -> ModemConfig -> CharSendDelay,
  144.                         LAIN_Min,        0,
  145.                         LAIN_UseIncrementers,    TRUE,
  146.                     TAG_DONE);
  147.  
  148.                     LT_EndGroup(Handle);
  149.                 }
  150.  
  151.                 LT_New(Handle,
  152.                     LA_Type,    VERTICAL_KIND,
  153.                 TAG_DONE);
  154.                 {
  155.                     LT_New(Handle,
  156.                         LA_Type,    STRING_KIND,
  157.                         LA_LabelID,    MSG_MODEMPANEL_NO_CARRIER_STRING_GAD,
  158.                         LA_STRPTR,    Config -> ModemConfig -> NoCarrier,
  159.                         LA_Chars,    20,
  160.                         GTST_MaxChars,    15,
  161.                     TAG_DONE);
  162.  
  163.                     LT_New(Handle,
  164.                         LA_Type,    STRING_KIND,
  165.                         LA_LabelID,    MSG_MODEMPANEL_NO_DIALTONE_STRING_GAD,
  166.                         LA_STRPTR,    Config -> ModemConfig -> NoDialTone,
  167.                         GTST_MaxChars,    15,
  168.                     TAG_DONE);
  169.  
  170.                     LT_New(Handle,
  171.                         LA_Type,    STRING_KIND,
  172.                         LA_LabelID,    MSG_MODEMPANEL_CONNECT_STRING_GAD,
  173.                         LA_STRPTR,    Config -> ModemConfig -> Connect,
  174.                         GTST_MaxChars,    15,
  175.                     TAG_DONE);
  176.  
  177.                     LT_New(Handle,
  178.                         LA_Type,    STRING_KIND,
  179.                         LA_LabelID,    MSG_MODEMPANEL_VOICE_STRING_GAD,
  180.                         LA_STRPTR,    Config -> ModemConfig -> Voice,
  181.                         GTST_MaxChars,    15,
  182.                     TAG_DONE);
  183.  
  184.                     LT_New(Handle,
  185.                         LA_Type,    STRING_KIND,
  186.                         LA_LabelID,    MSG_MODEMPANEL_RING_STRING_GAD,
  187.                         LA_STRPTR,    Config -> ModemConfig -> Ring,
  188.                         GTST_MaxChars,    15,
  189.                     TAG_DONE);
  190.  
  191.                     LT_New(Handle,
  192.                         LA_Type,    STRING_KIND,
  193.                         LA_LabelID,    MSG_MODEMPANEL_BUSY_STRING_GAD,
  194.                         LA_STRPTR,    Config -> ModemConfig -> Busy,
  195.                         GTST_MaxChars,    15,
  196.                     TAG_DONE);
  197.  
  198.                     LT_New(Handle,
  199.                         LA_Type,    STRING_KIND,
  200.                         LA_LabelID,    MSG_MODEMPANEL_OK_STRING_GAD,
  201.                         LA_STRPTR,    Config -> ModemConfig -> Ok,
  202.                         GTST_MaxChars,    15,
  203.                     TAG_DONE);
  204.  
  205.                     LT_New(Handle,
  206.                         LA_Type,    STRING_KIND,
  207.                         LA_LabelID,    MSG_MODEMPANEL_ERROR_STRING_GAD,
  208.                         LA_STRPTR,    Config -> ModemConfig -> Error,
  209.                         GTST_MaxChars,    15,
  210.                     TAG_DONE);
  211.  
  212.                     LT_EndGroup(Handle);
  213.                 }
  214.  
  215.                 LT_New(Handle,
  216.                     LA_Type,    VERTICAL_KIND,
  217.                 TAG_DONE);
  218.                 {
  219.                     BOOL NotFound = TRUE;
  220.                     WORD i;
  221.  
  222.                     for(i = 0 ; NotFound && i < strlen(Config -> ModemConfig -> DialPrefix) - 1 ; i++)
  223.                     {
  224.                         if(Config -> ModemConfig -> DialPrefix[i] == '\\' && ToUpper(Config -> ModemConfig -> DialPrefix[i + 1]) == 'W')
  225.                             NotFound = FALSE;
  226.                     }
  227.  
  228.                     for(i = 0 ; NotFound && i < strlen(Config -> ModemConfig -> DialSuffix) - 1 ; i++)
  229.                     {
  230.                         if(Config -> ModemConfig -> DialSuffix[i] == '\\' && ToUpper(Config -> ModemConfig -> DialSuffix[i + 1]) == 'W')
  231.                             NotFound = FALSE;
  232.                     }
  233.  
  234.                     LT_New(Handle,
  235.                         LA_Type,    STRING_KIND,
  236.                         LA_LabelID,    MSG_MODEMPANEL_DIAL_PREFIX_GAD,
  237.                         LA_STRPTR,    Config -> ModemConfig -> DialPrefix,
  238.                         LA_Chars,    20,
  239.                         LA_ID,        GAD_DIAL_PREFIX,
  240.                         GTST_MaxChars,    79,
  241.                     TAG_DONE);
  242.  
  243.                     LT_New(Handle,
  244.                         LA_Type,    STRING_KIND,
  245.                         LA_LabelID,    MSG_MODEMPANEL_DIAL_SUFFIX_GAD,
  246.                         LA_STRPTR,    Config -> ModemConfig -> DialSuffix,
  247.                         LA_ID,        GAD_DIAL_SUFFIX,
  248.                         GTST_MaxChars,    79,
  249.                     TAG_DONE);
  250.  
  251.                     LT_New(Handle,
  252.                         LA_Type,        CYCLE_KIND,
  253.                         LA_LabelID,        MSG_DIALMODE2_GAD,
  254.                         LA_BYTE,        &Config -> ModemConfig -> DialMode,
  255.                         LA_ID,            GAD_DIAL_MODE,
  256.                         LACY_FirstLabel,    MSG_DIALMODE1_TXT,
  257.                         LACY_LastLabel,        MSG_DIALMODE2_TXT,
  258.                         GA_Disabled,        NotFound,
  259.                     TAG_DONE);
  260.  
  261.                     LT_New(Handle,
  262.                         LA_Type,        XBAR_KIND,
  263.                     TAG_DONE);
  264.  
  265.                     LT_New(Handle,
  266.                         LA_Type,        SliderType,
  267.                         LA_LabelID,        MSG_MODEMPANEL_REDIAL_DELAY_GAD,
  268.                         LA_LONG,        &Config -> ModemConfig -> RedialDelay,
  269.                         GTSL_Min,        0,
  270.                         GTSL_Max,        60 * 60,
  271.                         GTSL_DispFunc,        ShowSeconds,
  272.                         GTSL_LevelFormat,    "%s",
  273.                     TAG_DONE);
  274.  
  275.                     LT_New(Handle,
  276.                         LA_Type,        SliderType,
  277.                         LA_LabelID,        MSG_MODEMPANEL_DIAL_RETRIES_GAD,
  278.                         LA_LONG,        &Config -> ModemConfig -> DialRetries,
  279.                         GTSL_DispFunc,        ShowDialRetries,
  280.                         GTSL_Min,        -1,
  281.                         GTSL_Max,        1000,
  282.                         GTSL_LevelFormat,    "%s",
  283.                     TAG_DONE);
  284.  
  285.                     LT_New(Handle,
  286.                         LA_Type,        SliderType,
  287.                         LA_LabelID,        MSG_MODEMPANEL_DIAL_TIMEOUT_GAD,
  288.                         LA_LONG,        &Config -> ModemConfig -> DialTimeout,
  289.                         GTSL_Min,        0,
  290.                         GTSL_Max,        1800,
  291.                         GTSL_DispFunc,        ShowSeconds,
  292.                         GTSL_LevelFormat,    "%s",
  293.                     TAG_DONE);
  294.  
  295.                     LT_New(Handle,
  296.                         LA_Type,        SliderType,
  297.                         LA_LabelID,        MSG_INTER_DIAL_DELAY_TXT,
  298.                         LA_LONG,        &Config -> ModemConfig -> InterDialDelay,
  299.                         GTSL_Min,        0,
  300.                         GTSL_Max,        1800,
  301.                         GTSL_DispFunc,        ShowSeconds,
  302.                         GTSL_LevelFormat,    "%s",
  303.                     TAG_DONE);
  304.  
  305.                     LT_New(Handle,
  306.                         LA_Type,        CHECKBOX_KIND,
  307.                         LA_LabelID,        MSG_VERBOSE_DIALING_TXT,
  308.                         LA_BYTE,        &Config -> ModemConfig -> VerboseDialing,
  309.                     TAG_DONE);
  310.  
  311.                     LT_New(Handle,
  312.                         LA_Type,        XBAR_KIND,
  313.                     TAG_DONE);
  314.  
  315.                     LT_New(Handle,
  316.                         LA_Type,        CHECKBOX_KIND,
  317.                         LA_LabelID,        MSG_MODEMPANEL_CONNECT_AUTO_BAUD_GAD,
  318.                         LA_BYTE,        &Config -> ModemConfig -> ConnectAutoBaud,
  319.                     TAG_DONE);
  320.  
  321.                     LT_New(Handle,
  322.                         LA_Type,        CHECKBOX_KIND,
  323.                         LA_LabelID,        MSG_MODEMPANEL_NOCARRIER_IS_BUSY_GAD,
  324.                         LA_BYTE,        &Config -> ModemConfig -> NoCarrierIsBusy,
  325.                     TAG_DONE);
  326.  
  327.                     LT_New(Handle,
  328.                         LA_Type,        CHECKBOX_KIND,
  329.                         LA_LabelID,        MSG_MODEMPANEL_ABORT_HANGS_UP_TXT,
  330.                         LA_BYTE,        &Config -> ModemConfig -> AbortHangsUp,
  331.                     TAG_DONE);
  332.  
  333.                     LT_New(Handle,
  334.                         LA_Type,        SliderType,
  335.                         LA_LabelID,        MSG_MODEMPANEL_TIME_TO_CONNECT_GAD,
  336.                         LA_LONG,        &Config -> ModemConfig -> TimeToConnect,
  337.                         LA_Chars,        8,
  338.                         GTSL_Min,        0,
  339.                         GTSL_Max,        60 * 60,
  340.                         GTSL_DispFunc,        ShowSeconds,
  341.                         GTSL_LevelFormat,    "%s",
  342.                     TAG_DONE);
  343.  
  344.                     LT_EndGroup(Handle);
  345.                 }
  346.  
  347.                 LT_New(Handle,
  348.                     LA_Type,    VERTICAL_KIND,
  349.                 TAG_DONE);
  350.                 {
  351.                     LT_New(Handle,
  352.                         LA_Type,        CHECKBOX_KIND,
  353.                         LA_LabelID,        MSG_MODEMPANEL_DROP_DTR_ON_HANGUP_GAD,
  354.                         LA_BYTE,        &Config -> ModemConfig -> DropDTR,
  355.                     TAG_DONE);
  356.  
  357.                     LT_New(Handle,
  358.                         LA_Type,        CHECKBOX_KIND,
  359.                         LA_LabelID,        MSG_MODEMPANEL_REDIAL_AFTER_HANGUP_GAD,
  360.                         LA_BYTE,        &Config -> ModemConfig -> RedialAfterHangup,
  361.                     TAG_DONE);
  362.  
  363.                     LT_EndGroup(Handle);
  364.                 }
  365.  
  366.                 LT_New(Handle,
  367.                     LA_Type,    VERTICAL_KIND,
  368.                 TAG_DONE);
  369.                 {
  370.                     LT_New(Handle,
  371.                         LA_Type,        SliderType,
  372.                         LA_LabelID,        MSG_MODEMPANEL_CONNECTION_LIMIT_GAD,
  373.                         LA_WORD,        &Config -> ModemConfig -> ConnectLimit,
  374.                         GTSL_Min,        0,
  375.                         GTSL_Max,        1440,
  376.                         GTSL_DispFunc,        ShowHours,
  377.                         GTSL_LevelFormat,    "%s",
  378.                     TAG_DONE);
  379.  
  380.                     LT_New(Handle,
  381.                         LA_Type,        STRING_KIND,
  382.                         LA_LabelID,        MSG_MODEMPANEL_LIMIT_MACRO_GAD,
  383.                         LA_STRPTR,        Config -> ModemConfig -> ConnectLimitMacro,
  384.                         LA_Chars,        20,
  385.                         LA_ID,            GAD_LIMIT_MACRO,
  386.                         GTST_MaxChars,        MAX_FILENAME_LENGTH - 1,
  387.                     TAG_DONE);
  388.  
  389.                     LT_EndGroup(Handle);
  390.                 }
  391.  
  392.                 LT_EndGroup(Handle);
  393.             }
  394.  
  395.             LT_New(Handle,
  396.                 LA_Type,    VERTICAL_KIND,
  397.             TAG_DONE);
  398.             {
  399.                 LT_New(Handle,LA_Type,XBAR_KIND,LAXB_FullSize,TRUE,TAG_DONE);
  400.  
  401.                 LT_EndGroup(Handle);
  402.             }
  403.  
  404.             LT_New(Handle,LA_Type,HORIZONTAL_KIND,
  405.                 LAGR_SameSize,    TRUE,
  406.                 LAGR_Spread,    TRUE,
  407.             TAG_DONE);
  408.             {
  409.                 LT_New(Handle,
  410.                     LA_Type,    BUTTON_KIND,
  411.                     LA_LabelID,    MSG_GLOBAL_USE_GAD,
  412.                     LA_ID,        GAD_USE,
  413.                     LABT_ReturnKey,    TRUE,
  414.                     LABT_ExtraFat,    TRUE,
  415.                 TAG_DONE);
  416.  
  417.                 if(Default)
  418.                 {
  419.                     LT_New(Handle,
  420.                         LA_Type,    BUTTON_KIND,
  421.                         LA_LabelID,    MSG_GLOBAL_DEFAULT_GAD,
  422.                         LA_ID,        GAD_DEFAULT,
  423.                         LABT_ExtraFat,    TRUE,
  424.                     TAG_DONE);
  425.                 }
  426.  
  427.                 LT_New(Handle,
  428.                     LA_Type,    BUTTON_KIND,
  429.                     LA_LabelID,    MSG_GLOBAL_CANCEL_GAD,
  430.                     LA_ID,        GAD_CANCEL,
  431.                     LABT_EscKey,    TRUE,
  432.                     LABT_ExtraFat,    TRUE,
  433.                 TAG_DONE);
  434.  
  435.                 LT_EndGroup(Handle);
  436.             }
  437.  
  438.             LT_EndGroup(Handle);
  439.         }
  440.  
  441.         if(PanelWindow = LT_Layout(Handle,LocaleString(MSG_MODEMPANEL_MODEM_PREFERENCES_TXT),NULL,0,0,IDCMP_CLOSEWINDOW,0,
  442.             LAWN_HelpHook,        &GuideHook,
  443.             LAWN_Parent,        Window,
  444.             WA_DepthGadget,        TRUE,
  445.             WA_CloseGadget,        TRUE,
  446.             WA_DragBar,        TRUE,
  447.             WA_RMBTrap,        TRUE,
  448.             WA_Activate,        TRUE,
  449.         TAG_DONE))
  450.         {
  451.             struct IntuiMessage    *Message;
  452.             BOOLEAN             Done = FALSE;
  453.             ULONG             MsgClass,
  454.                          MsgQualifier;
  455.             UWORD             MsgCode;
  456.             struct Gadget        *MsgGadget;
  457.             WORD             i;
  458.             BOOL             NotFound;
  459.  
  460.             GuideContext(CONTEXT_MODEM);
  461.  
  462.             PushWindow(PanelWindow);
  463.  
  464.             LT_ShowWindow(Handle,TRUE);
  465.  
  466.             do
  467.             {
  468.                 if(Wait(PORTMASK(PanelWindow -> UserPort) | SIG_BREAK) & SIG_BREAK)
  469.                 {
  470.                     SaveConfig(PrivateConfig,Config);
  471.  
  472.                     break;
  473.                 }
  474.  
  475.                 while(Message = (struct IntuiMessage *)GT_GetIMsg(PanelWindow -> UserPort))
  476.                 {
  477.                     MsgClass    = Message -> Class;
  478.                     MsgQualifier    = Message -> Qualifier;
  479.                     MsgCode        = Message -> Code;
  480.                     MsgGadget    = (struct Gadget *)Message -> IAddress;
  481.  
  482.                     GT_ReplyIMsg(Message);
  483.  
  484.                     LT_HandleInput(Handle,MsgQualifier,&MsgClass,&MsgCode,&MsgGadget);
  485.  
  486.                     if(MsgClass == IDCMP_CLOSEWINDOW)
  487.                     {
  488.                         SaveConfig(PrivateConfig,Config);
  489.  
  490.                         Done = TRUE;
  491.                     }
  492.  
  493.                     if(MsgClass == IDCMP_GADGETUP)
  494.                     {
  495.                         switch(MsgGadget -> GadgetID)
  496.                         {
  497.                             case GAD_DIAL_PREFIX:
  498.                             case GAD_DIAL_SUFFIX:
  499.                             case GAD_DIAL_MODE:
  500.  
  501.                                 for(i = 0, NotFound = TRUE ; NotFound && i < strlen(Config -> ModemConfig -> DialPrefix) - 1 ; i++)
  502.                                 {
  503.                                     if(Config -> ModemConfig -> DialPrefix[i] == '\\' && ToUpper(Config -> ModemConfig -> DialPrefix[i + 1]) == 'W')
  504.                                         NotFound = FALSE;
  505.                                 }
  506.  
  507.                                 for(i = 0 ; NotFound && i < strlen(Config -> ModemConfig -> DialSuffix) - 1 ; i++)
  508.                                 {
  509.                                     if(Config -> ModemConfig -> DialSuffix[i] == '\\' && ToUpper(Config -> ModemConfig -> DialSuffix[i + 1]) == 'W')
  510.                                         NotFound = FALSE;
  511.                                 }
  512.  
  513.                                 LT_SetAttributes(Handle,GAD_DIAL_MODE,
  514.                                     GA_Disabled,NotFound,
  515.                                 TAG_DONE);
  516.  
  517.                                 break;
  518.  
  519.                             case GAD_USE:
  520.  
  521.                                 LT_UpdateStrings(Handle);
  522.  
  523.                                 Done = TRUE;
  524.                                 break;
  525.  
  526.                             case GAD_CANCEL:
  527.  
  528.                                 SaveConfig(PrivateConfig,Config);
  529.  
  530.                                 Cancel = Done = TRUE;
  531.                                 break;
  532.  
  533.                             case GAD_DEFAULT:
  534.  
  535.                                 *Default = TRUE;
  536.  
  537.                                 Done = TRUE;
  538.                                 break;
  539.                         }
  540.                     }
  541.                 }
  542.             }
  543.             while(!Done);
  544.  
  545.             PopWindow();
  546.         }
  547.  
  548.         LT_DeleteHandle(Handle);
  549.     }
  550.  
  551.     if(!Cancel && Config -> MiscConfig && Config -> SerialConfig)
  552.     {
  553.         if(Config -> MiscConfig -> ProtectiveMode && Config -> SerialConfig -> BaudRate >= 4800 && Config -> ModemConfig -> ConnectAutoBaud)
  554.         {
  555.             if(MyEasyRequest(Window,LocaleString(MSG_AUTOBAUD_TXT),LocaleString(MSG_GLOBAL_YES_NO_TXT)))
  556.                 Config -> ModemConfig -> ConnectAutoBaud = FALSE;
  557.         }
  558.     }
  559.  
  560.     if(Default)
  561.         return((BYTE)(!Cancel));
  562.     else
  563.         return((BYTE)memcmp(PrivateConfig -> ModemConfig,Config -> ModemConfig,sizeof(struct ModemSettings)));
  564. }
  565.